import { axios } from '@/utils/request'

export function getRepaymentRecord (params) {
    return axios({
        url: 'finance/repayment',
        method: 'get',
        params
    })
}

export function getRepaymentDetail (loanedOrderNo) {
    return axios({
        url: 'finance/repayment/' + loanedOrderNo,
        method: 'get'
    })
}

export function generateRepaymentCode (loanedOrderNo, data) {
    return axios({
        url: 'finance/repayment/' + loanedOrderNo,
        method: 'post',
        data
    })
}

export function getFlatRecord (params) {
    return axios({
        url: 'finance/flat',
        method: 'get',
        params
    })
}

export function getFlatDetail (loanedOrderNo) {
    return axios({
        url: 'finance/flat/' + loanedOrderNo,
        method: 'get'
    })
}

export function createFlatRecord (loanedOrderNo, data) {
    return axios({
        url: 'finance/flat/' + loanedOrderNo,
        method: 'post',
        data
    })
}
